home *** CD-ROM | disk | FTP | other *** search
/ Deutsche Edition 1 / Deutsche Edition 1.iso / amok / amok_lha / amok22.lha / MakeKickRes / Exec.def next >
Text File  |  1993-08-15  |  14KB  |  512 lines

  1. DEFINITION MODULE Exec {"exec.library",33};
  2.  
  3. FROM SYSTEM IMPORT
  4.  ADDRESS,BITSET,BYTE,LONGSET,WORD;
  5.  
  6. IMPORT Hardware;
  7.  
  8. TYPE
  9.  Byte=[-128..127];
  10.  UByte=[0..255];
  11.  NodeType=(
  12.   unknown,task,interrupt,device,msgPort,message,freeMsg,
  13.   replyMsg,resource,library,memory,softInt,font,process,
  14.   semaphore,signalSem
  15.  );
  16.  NodePtr=POINTER TO Node;
  17.  Node=RECORD
  18.   succ:NodePtr;
  19.   pred:NodePtr;
  20.   type:NodeType;
  21.   pri:Byte;
  22.   name:ADDRESS;
  23.  END;
  24.  MinNodePtr=POINTER TO MinNode;
  25.  MinNode=RECORD
  26.   succ:MinNodePtr;
  27.   pred:MinNodePtr;
  28.  END;
  29.  List=RECORD
  30.   head:NodePtr;
  31.   tail:NodePtr;
  32.   tailPred:NodePtr;
  33.   type:NodeType;
  34.   pad:BYTE;
  35.  END;
  36.  ListPtr=POINTER TO List;
  37.  MinList=RECORD
  38.   head:MinNodePtr;
  39.   tail:MinNodePtr;
  40.   tailPred:MinNodePtr;
  41.  END;
  42.  MinListPtr=POINTER TO MinList;
  43.  Interrupt=RECORD
  44.   node:Node;
  45.   data:ADDRESS;
  46.   code:PROC;
  47.  END;
  48.  InterruptPtr=POINTER TO Interrupt;
  49.  IntVector=RECORD
  50.   data:ADDRESS;
  51.   code:PROC;
  52.   node:NodePtr;
  53.  END;
  54.  SoftIntList=RECORD
  55.   list:List;
  56.   pad:WORD;
  57.  END;
  58.  MemReqs=(
  59.   public,chip,fast,mr3,mr4,mr5,mr6,mr7,
  60.   mr8,mr9,mr10,mr11,mr12,mr13,mr14,mr15,memClear,largest
  61.  );
  62.  MemReqSet=SET OF MemReqs;
  63.  MemTypeSet=SET OF [public..mr15];
  64.  MemChunkPtr=POINTER TO MemChunk;
  65.  MemChunk=RECORD
  66.   next:MemChunkPtr;
  67.   bytes:LONGCARD;
  68.  END;
  69.  MemHeader=RECORD
  70.   node:Node;
  71.   attributes:MemTypeSet;
  72.   first:MemChunkPtr;
  73.   lower:ADDRESS;
  74.   upper:ADDRESS;
  75.   free:LONGCARD;
  76.  END;
  77.  MemHeaderPtr=POINTER TO MemHeader;
  78.  MemEntry=RECORD
  79.   CASE :INTEGER OF
  80.   | 1:reqs:MemReqSet
  81.   | 2:addr:ADDRESS
  82.   END;
  83.   length:LONGCARD;
  84.  END;
  85.  MemList=RECORD
  86.   node:Node;
  87.   numEntries:CARDINAL;
  88. (*me:ARRAY [0..munEntries-1] OF MemEntry;*)
  89.  END;
  90.  MemListPtr=POINTER TO MemList;
  91.  MsgPortAction=(signal, softint, ignore);
  92.  TaskPtr=POINTER TO Task;
  93.  MsgPort=RECORD
  94.   node:Node;
  95.   CASE flags:MsgPortAction OF
  96.   | signal:
  97.    sigBit:UByte;
  98.    sigTask:TaskPtr;
  99.   | softint:
  100.    pad0:BYTE;
  101.    softInt:InterruptPtr;
  102.   | ignore:
  103.    pad1:BYTE;
  104.    pad2:ADDRESS
  105.   END;
  106.   msgList:List;
  107.  END;
  108.  MsgPortPtr=POINTER TO MsgPort;
  109.  Message=RECORD
  110.   node:Node;
  111.   replyPort:MsgPortPtr;
  112.   length:CARDINAL;
  113.  END;
  114.  MessagePtr=POINTER TO Message;
  115.  TaskFlags=(
  116.   procTime,tf1,tf2,tf3,stackChk,exception,switch,launch
  117.  );
  118.  TaskFlagSet=SET OF TaskFlags;
  119.  TaskState=(inval,added,run,ready,wait,except,removed);
  120.  Task=RECORD
  121.   node:Node;
  122.   flags:TaskFlagSet;
  123.   state:TaskState;
  124.   idNestCnt:BYTE;
  125.   tdNestCnt:BYTE;
  126.   sigAlloc:LONGSET;
  127.   sigWait:LONGSET;
  128.   sigRecvd:LONGSET;
  129.   sigExcept:LONGSET;
  130.   trapAlloc:BITSET;
  131.   trapAble:BITSET;
  132.   exceptData:ADDRESS;
  133.   exceptCode:PROC;
  134.   trapData:ADDRESS;
  135.   trapCode:PROC;
  136.   spReg:ADDRESS;
  137.   spLower:ADDRESS;
  138.   spUpper:ADDRESS;
  139.   switch:PROC;
  140.   launch:PROC;
  141.   memEntry:List;
  142.   userData:ADDRESS;
  143.  END;
  144.  
  145. CONST
  146.   (* Vordefinierte Signalnummern *)
  147.  sigAbort=0;
  148.  sigChild=1;
  149.  sigBlit=4;
  150.  sigDos=8;
  151.  
  152.  vectSize=6;
  153.  reserved=4;
  154.  base=-vectSize;
  155.  userDef=base-reserved*vectSize-30;
  156.  nonStd=userDef;
  157.  extFunc=-24;
  158.  expunge=-18;
  159.  close=-12;
  160.  open=-6;
  161.  
  162. TYPE
  163.  LibFlags=(summing,changed,sumUsed,delExp);
  164.  LibFlagSet=SET OF LibFlags;
  165.  Library=RECORD
  166.   node:Node;
  167.   flags:LibFlagSet;
  168.   pad:BYTE;
  169.   negSize:CARDINAL;
  170.   posSize:CARDINAL;
  171.   version:CARDINAL;
  172.   revision:CARDINAL;
  173.   idString:ADDRESS;
  174.   sum:LONGCARD;
  175.   openCnt:CARDINAL;
  176.  END;
  177.  LibraryPtr=POINTER TO Library;
  178.  Device=RECORD
  179.   library:Library;
  180.  END;
  181.  DevicePtr=POINTER TO Device;
  182.  UnitFlags=(active,inTask);
  183.  UnitFlagSet=SET OF UnitFlags;
  184.  UnitPtr=POINTER TO Unit;
  185.  Unit=RECORD
  186.   msgPort:MsgPortPtr;
  187.   flags:UnitFlagSet;
  188.   pad:BYTE;
  189.   openCnt:CARDINAL;
  190.  END;
  191.  
  192. CONST
  193.   (* Standardbefehle für IORequest.command *)
  194.  invalid=0;
  195.  reset=1;
  196.  read=2;
  197.  write=3;
  198.  update=4;
  199.  clear=5;
  200.  stop=6;
  201.  start=7;
  202.  flush=8;
  203.  nonstd=9;
  204.   (* Offstes der Devicespezifischen Funktionen  *)
  205.  abortIO=-36;
  206.  beginIO=-30;
  207.  
  208. TYPE
  209.  IOFlagSet=SET OF [0..7];
  210.  
  211. CONST
  212.  quick=IOFlagSet{0};
  213.  
  214. TYPE
  215.  IORequest=RECORD
  216.   message:Message;
  217.   device:DevicePtr;
  218.   unit:UnitPtr;
  219.   command:CARDINAL;
  220.   flags:IOFlagSet;
  221.   error:Byte;
  222.  END;
  223.  IORequestPtr=POINTER TO IORequest;
  224.  IOStdReq=RECORD
  225.   message:Message;
  226.   device:DevicePtr;
  227.   unit:UnitPtr;
  228.   command:CARDINAL;
  229.   flags:IOFlagSet;
  230.   error:Byte;
  231.   actual:LONGCARD;
  232.   length:LONGCARD;
  233.   data:ADDRESS;
  234.   offset:LONGCARD;
  235.  END;
  236.  IOStdReqPtr=POINTER TO IOStdReq;
  237.  Semaphore=RECORD
  238.   msgPort:MsgPort;
  239.   bids:INTEGER;
  240.  END;
  241.  SemaphoreRequest=RECORD
  242.   link:MinNode;
  243.   waiter:TaskPtr;
  244.  END;
  245.  SignalSemaphore=RECORD
  246.   link:Node;
  247.   nestCount:INTEGER;
  248.   waitQueue:MinList;
  249.   multipleLink:SemaphoreRequest;
  250.   owner:TaskPtr;
  251.   queueCount:INTEGER;
  252.  END;
  253.  SignalSemaphorePtr=POINTER TO SignalSemaphore;
  254.  ResidentFlags=(coldstart,rf1,rf2,rf3,rf4,rf5,rf6,autoinit);
  255.  ResidentFlagSet=SET OF ResidentFlags;
  256.  ResidentPtr=POINTER TO Resident;
  257.  Resident=RECORD
  258.   matchWord:CARDINAL;
  259.   matchTag:ResidentPtr;
  260.   endSkip:ADDRESS;
  261.   flags:ResidentFlagSet;
  262.   version:UByte;
  263.   type:NodeType;
  264.   pri:Byte;
  265.   name:ADDRESS;
  266.   idString:ADDRESS;
  267.   init:ADDRESS;
  268.  END;
  269.  
  270. CONST
  271.  matchword=04AFCH;
  272.  
  273. TYPE
  274.  AttnFlags=(
  275.   m68010,m68020,af2,af3,m68881,af5,af6,af7,
  276.   reserved8,reserved9
  277.  );
  278.  AttnFlagSet=SET OF AttnFlags;
  279.  ExecBase=RECORD
  280.   libNode:Library;
  281.   softVer:CARDINAL;
  282.   lowMemChkSum:INTEGER;
  283.   chkBase:LONGCARD;
  284.   coldCapture:ADDRESS;
  285.   coolCapture:ADDRESS;
  286.   warmCapture:ADDRESS;
  287.   sysStkUpper:ADDRESS;
  288.   sysStkLower:ADDRESS;
  289.   maxLocMem:LONGCARD;
  290.   debugEntry:ADDRESS;
  291.   debugData:ADDRESS;
  292.   alertData:ADDRESS;
  293.   maxExtMem:ADDRESS;
  294.   chkSum:CARDINAL;
  295.   intVects:ARRAY Hardware.IntFlags OF IntVector;
  296.   thisTask:TaskPtr;
  297.   idleCount:LONGCARD;
  298.   dispCount:LONGCARD;
  299.   quantum:CARDINAL;
  300.   elapsed:CARDINAL;
  301.   sysFlags:CARDINAL;
  302.   idNestCnt:BYTE;
  303.   tdNestCnt:BYTE;
  304.   attnFlags:AttnFlagSet;
  305.   attnResched:CARDINAL;
  306.   resModules:ADDRESS;
  307.   taskTrapCode:PROC;
  308.   taskExceptCode:PROC;
  309.   taskExitCode:PROC;
  310.   taskSigAlloc:LONGSET;
  311.   taskTrapAlloc:BITSET;
  312.   memList:List;
  313.   resourceList:List;
  314.   deviceList:List;
  315.   intrList:List;
  316.   libList:List;
  317.   portList:List;
  318.   taskReady:List;
  319.   taskWait:List;
  320.   softInts:ARRAY [0..4] OF SoftIntList;
  321.   lastAlert:ARRAY [0..3] OF LONGINT;
  322.   vBlankFrequency:UByte;
  323.   powerSupplyFrequency:UByte;
  324.   semaphoreList:List;
  325.   kickMemPtr:ADDRESS;
  326.   kickTagPtr:ADDRESS;
  327.   kickCheckSum:LONGINT;
  328.   execBaseReserved:ARRAY [0..9] OF BYTE;
  329.   execBaseNewReserved:ARRAY [0..19] OF BYTE;
  330.  END;
  331.  ExecBasePtr=POINTER TO ExecBase;
  332.  
  333. VAR
  334.  execBase[4]:ExecBasePtr;
  335.  
  336. PROCEDURE AbortIO(iORequest{9}:ADDRESS); CODE -480;
  337. PROCEDURE AddDevice(device{9}:DevicePtr); CODE -432;
  338. PROCEDURE AddHead(list{8}:ListPtr;
  339.                   node{9}:ADDRESS); CODE -240;
  340. PROCEDURE AddIntServer(intNum{0}:INTEGER;
  341.                        interrupt{9}:InterruptPtr); CODE -168;
  342. PROCEDURE AddLibrary(library{9}:LibraryPtr); CODE -396;
  343. PROCEDURE AddMemList(size{0}:LONGINT;
  344.                      attributes{1}:MemReqSet;
  345.                      pri{2}:LONGINT;
  346.                      base{8}:ADDRESS;
  347.                      name{9}:ADDRESS):LONGINT; CODE -618;
  348. PROCEDURE AddPort(port{9}:MsgPortPtr); CODE -354;
  349. PROCEDURE AddResource(resource{9}:ADDRESS); CODE -486;
  350. PROCEDURE AddSemaphore(
  351.            signalSemaphore{8}:SignalSemaphorePtr); CODE -600;
  352. PROCEDURE AddTail(list{8}:ListPtr;
  353.                   node{9}:ADDRESS); CODE -246;
  354. PROCEDURE AddTask(task{9}:TaskPtr;
  355.                   initialPC{10}:ADDRESS;
  356.                   finalPC{11}:ADDRESS); CODE -282;
  357. PROCEDURE Alert(alertNum{7}:LONGINT;
  358.                 parameters{13}:ADDRESS); CODE -108;
  359. PROCEDURE AllocAbs(byteSize{0}:LONGINT;
  360.                    location{9}:ADDRESS):ADDRESS; CODE -204;
  361. PROCEDURE Allocate(freeList{8}:MemHeaderPtr;
  362.                    byteSize{0}:LONGINT):ADDRESS; CODE -186;
  363. PROCEDURE AllocEntry(
  364.            memList1{8}:MemListPtr):MemListPtr; CODE -222;
  365. PROCEDURE AllocMem(
  366.            byteSize{0}:LONGINT;
  367.            requirements{1}:MemReqSet):ADDRESS; CODE -198;
  368. PROCEDURE AllocSignal(
  369.            signalNum1{0}:LONGINT):LONGINT; CODE -330;
  370. PROCEDURE AllocTrap(trapNum1{0}:LONGINT):LONGINT; CODE -342;
  371. PROCEDURE AttemptSemaphore(
  372.            signalSemaphore{8}:SignalSemaphorePtr
  373.           ):LONGINT; CODE -576;
  374. PROCEDURE AvailMem(
  375.            requirements{1}:MemReqSet):LONGINT; CODE -216;
  376. PROCEDURE Cause(interrupt{9}:InterruptPtr); CODE -180;
  377. PROCEDURE CheckIO(ioRequest{9}:ADDRESS):ADDRESS; CODE -468;
  378. PROCEDURE CloseDevice(ioRequest{9}:ADDRESS); CODE -450;
  379. PROCEDURE CloseLibrary(library{9}:LibraryPtr); CODE -414;
  380. PROCEDURE CopyMem(source{8}:ADDRESS;
  381.                   dest{9}:ADDRESS;
  382.                   size{0}:LONGINT); CODE -624;
  383. PROCEDURE CopyMemQuick(source{8}:ADDRESS;
  384.                        dest{9}:ADDRESS;
  385.                        size{0}:LONGINT); CODE -630;
  386. PROCEDURE Deallocate(freeList{8}:MemHeaderPtr;
  387.                      memoryBlock{9}:ADDRESS;
  388.                      byteSize{0}:LONGINT); CODE -192;
  389. PROCEDURE Debug(); CODE -114;
  390. PROCEDURE Disable(); CODE -120;
  391. (* PRIVATE *) PROCEDURE Dispatch(); CODE -60;
  392. PROCEDURE DoIO(ioRequest{9}:ADDRESS); CODE -456;
  393. PROCEDURE Enable(); CODE -126;
  394. PROCEDURE Enqueue(list{8}:ListPtr;
  395.                   node{9}:ADDRESS); CODE -270;
  396. (* PRIVATE *) PROCEDURE Exception(); CODE -66;
  397. (* PRIVATE *) PROCEDURE ExitIntr(); CODE -36;
  398. PROCEDURE FindName(start{8}:ADDRESS;
  399.                    name{9}:ADDRESS):ADDRESS; CODE -276;
  400. PROCEDURE FindPort(name{9}:ADDRESS):MsgPortPtr; CODE -390;
  401. PROCEDURE FindResident(
  402.            name{9}:ADDRESS):ResidentPtr; CODE -96;
  403. PROCEDURE FindSemaphore(
  404.            name{8}:ADDRESS):SignalSemaphorePtr; CODE -594;
  405. PROCEDURE FindTask(name{9}:ADDRESS):TaskPtr; CODE -294;
  406. PROCEDURE Forbid(); CODE -132;
  407. PROCEDURE FreeEntry(memList{8}:MemListPtr); CODE -228;
  408. PROCEDURE FreeMem(memoryBlock{9}:ADDRESS;
  409.                   byteSize{0}:LONGINT); CODE -210;
  410. PROCEDURE FreeSignal(signalNum{0}:LONGINT); CODE -336;
  411. PROCEDURE FreeTrap(trapNum{0}:LONGINT); CODE -348;
  412. PROCEDURE GetCC():BITSET; CODE -528;
  413. PROCEDURE GetMsg(port{8}:MsgPortPtr):ADDRESS; CODE -372;
  414. PROCEDURE InitCode(startClass{0}:ResidentFlagSet;
  415.                    version{1}:LONGINT); CODE -72;
  416. PROCEDURE InitResident(resident{9}:ResidentPtr;
  417.                        segList{1}:ADDRESS); CODE -102;
  418. PROCEDURE InitSemaphore(
  419.            signalSemaphore{8}:SignalSemaphorePtr); CODE -558;
  420. PROCEDURE InitStruct(initTable{9}:ADDRESS;
  421.                      memory{10}:ADDRESS;
  422.                      size{0}:CARDINAL); CODE -78;
  423. PROCEDURE Insert(list{8}:ListPtr;
  424.                  node{9}:ADDRESS;
  425.                  listNode{10}:ADDRESS); CODE -234;
  426. PROCEDURE MakeFunctions(target{8}:ADDRESS;
  427.                         functArray{9}:ADDRESS;
  428.                         functDispBase{10}:ADDRESS); CODE -90;
  429. PROCEDURE MakeLibrary(
  430.            vectors{8}:ADDRESS;
  431.            structure{9}:ADDRESS;
  432.            init{10}:ADDRESS;
  433.            dataSize{0}:LONGINT;
  434.            segList{1}:ADDRESS):LibraryPtr; CODE -84;
  435. PROCEDURE ObtainSemaphore(
  436.            signalSemaphore{8}:SignalSemaphorePtr); CODE -564;
  437. PROCEDURE ObtainSemaphoreList(list{8}:ListPtr); CODE -582;
  438. PROCEDURE OldOpenLibrary(
  439.            libName{9}:ADDRESS):LibraryPtr; CODE -408;
  440. PROCEDURE OpenDevice(devName{8}:ADDRESS;
  441.                      unitNumber{0}:LONGINT;
  442.                      ioRequest{9}:ADDRESS;
  443.                      flags{1}:LONGSET); CODE -444;
  444. PROCEDURE OpenLibrary(
  445.            libName{9}:ADDRESS;
  446.            version{0}:LONGINT):LibraryPtr; CODE -552;
  447. PROCEDURE OpenResource(resName{9}:ADDRESS):ADDRESS; CODE -498;
  448. PROCEDURE Permit(); CODE -138;
  449. PROCEDURE Procure(
  450.            semaphore{8}:MsgPortPtr;
  451.            bidMessage{9}:MsgPortPtr):LONGINT; CODE -540;
  452. PROCEDURE PutMsg(port{8}:MsgPortPtr;
  453.                  message{9}:ADDRESS); CODE -366;
  454. (* PRIVATE *) PROCEDURE RawDoFmt(
  455.                          formatString{8}:ADDRESS;
  456.                          dataStream{9}:ADDRESS;
  457.                          putChProc{10}:ADDRESS;
  458.                          putChData{11}:ADDRESS); CODE -522;
  459. (* PRIVATE *) PROCEDURE RawIOInit(); CODE -504;
  460. (* PRIVATE *) PROCEDURE RawMayGetChar():CHAR; CODE -510;
  461. (* PRIVATE *) PROCEDURE RawPutChar(ch{0}:CHAR); CODE -516;
  462. PROCEDURE ReleaseSemaphore(
  463.            signalSemaphore{8}:SignalSemaphorePtr); CODE -570;
  464. PROCEDURE ReleaseSemaphoreList(list{8}:ListPtr); CODE -588;
  465. PROCEDURE RemDevice(device{9}:DevicePtr):LONGINT; CODE -438;
  466. PROCEDURE RemHead(list{8}:ListPtr):ADDRESS; CODE -258;
  467. PROCEDURE RemIntServer(intNum{0}:INTEGER;
  468.                        interrupt{9}:InterruptPtr); CODE -174;
  469. PROCEDURE RemLibrary(
  470.            library{9}:LibraryPtr):LONGINT; CODE -402;
  471. PROCEDURE Remove(node{9}:ADDRESS); CODE -252;
  472. PROCEDURE RemPort(port{9}:MsgPortPtr); CODE -360;
  473. PROCEDURE RemResource(resource{9}:ADDRESS); CODE -492;
  474. PROCEDURE RemSemaphore(
  475.            signalSemaphore{8}:SignalSemaphorePtr); CODE -606;
  476. PROCEDURE RemTail(list{8}:ListPtr):ADDRESS; CODE -264;
  477. PROCEDURE RemTask(task{9}:TaskPtr); CODE -288;
  478. PROCEDURE ReplyMsg(message{9}:ADDRESS); CODE -378;
  479. (* PRIVATE *) PROCEDURE Reschedule(); CODE -48;
  480. (* PRIVATE *) PROCEDURE Schedule(); CODE -42;
  481. PROCEDURE SendIO(ioRequest{9}:ADDRESS); CODE -462;
  482. PROCEDURE SetExcept(newSignals{0}:LONGSET;
  483.                     signalMask{1}:LONGSET):LONGSET; CODE -312;
  484. PROCEDURE SetFunction(
  485.            library{9}:LibraryPtr;
  486.            funcOffset{8}:INTEGER;
  487.            funcEntry{0}:ADDRESS):ADDRESS; CODE -420;
  488. PROCEDURE SetIntVector(
  489.            intNumber{0}:Hardware.IntFlags;
  490.            interrupt{9}:InterruptPtr):InterruptPtr; CODE -162;
  491. PROCEDURE SetSignal(newSignals{0}:LONGSET;
  492.                     signalMask{1}:LONGSET):LONGSET; CODE -306;
  493. PROCEDURE SetSR(newSR{0}:BITSET;
  494.                 mask{1}:BITSET):BITSET; CODE -144;
  495. PROCEDURE SetTaskPri(task{9}:TaskPtr;
  496.                      priority{0}:Byte):Byte; CODE -300;
  497. PROCEDURE Signal(task{9}:TaskPtr;
  498.                  signals{0}:LONGSET); CODE -324;
  499. PROCEDURE SumKickData(): LONGINT; CODE -612;
  500. PROCEDURE SumLibrary(library{9}:LibraryPtr); CODE -426;
  501. PROCEDURE SuperState():ADDRESS; CODE -150;
  502. (* PRIVATE *) PROCEDURE Supervisor(); CODE -30;
  503. (* PRIVATE *) PROCEDURE Switch(); CODE -54;
  504. PROCEDURE TypeOfMem(address{9}:ADDRESS):MemReqSet; CODE -534;
  505. PROCEDURE UserState(sysStack{0}:ADDRESS); CODE -156;
  506. PROCEDURE Vacate(semaphore{8}:MsgPortPtr); CODE -546;
  507. PROCEDURE Wait(signalSet{0}:LONGSET):LONGSET; CODE -318;
  508. PROCEDURE WaitIO(ioRequest{9}:ADDRESS); CODE -474;
  509. PROCEDURE WaitPort(port{8}:MsgPortPtr); CODE -384;
  510.  
  511. END Exec.
  512.